<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Xpert</title>
<style type="text/css">

	html{
	
		margin:0px;
		padding:0px;
		font-family:Verdana, Arial, Helvetica, sans-serif;
	
	}
	
	body{
	
		margin:0px;
		padding:0px;
	
	}
	
	.top_wrapper{

		width:100%; 
		background-color:#F9F9F9; 
		height:44px
	
	}
	
	.text_centre{
		
		width:950px; 
		margin:0 auto; 
		text-align:center;
	
	}
	
	.top_left{
	
		width:500px; 
		float:left; 
		position:relative; 
		text-align:left; 
		font-size:80%; 
		font-weight:bold; 
		color:#434343; 
		padding-top:12px;
	
	}
	
	.top_left span{
		
		border-left:1px solid #D6D6D6; 
		padding:0 10px
	
	}
	
	.top_left span a, .top_right span a{
	
		color:#434343;
		
	}
	
	.top_right{
	
		width:450px; 
		float:right; 
		position:relative; 
		height:100%; 
		text-align:left; 
		font-size:80%; 
		font-weight:bold; 
		color:#434343; 
		padding-top:12px;
	
	}
	
	.top_right span{
		
		border-left:1px solid #D6D6D6; 
		padding:0 10px;
		
	}
	
	.main_wrapper{
	
		float:left; 
		position:relative; 
		width:100%; 
		text-align:center;
	
	}
	
	.page_holder{
	
		width:900px; 
		text-align:left; 
		margin:0 auto; 
		height:100px;
	
	}
	
	.logo{
		
		float:left; 
		position:relative; 
		height:100px; 
		width:149px;
	
	}
	
	.contributors{
	
		float:left; 
		position:relative; 
		height:500px; 
		width:100%; 
		background-color:#FFFFFF;  
		margin-top:20px; 
		text-align:center
	
	}
	
	.contributors a{
	
		color:#7C7C7C; 
		text-decoration:none;
	
	}

	.index_holder{
	
		width:950px; 
		margin:0 auto; 
		text-align:center;
	
	}
	
	.index_left{
	
		width:500px; 
		float:left; 
		position:relative; 
		height:500px; 
		background-color:#FFFFFF; 
		text-align:center;
	
	}
	
	.index_left p{
	
		font-size:80%; 
		font-weight:bold; 
		margin-top:40px;
	
	}
	
	.index_left p a{
	
		color:#434343;
	
	}
	
	.tag_cloud{
	
		width:450px; 
		float:left; 
		position:relative; 
		height:500px; 
		text-align:left
	
	}
	
	.tag_cloud p{
	
		color:#9C8A5A; 
		font-weight:bold; 
		font-size:110%; 
		padding-top:38px;
	
	}

</style>

</head>
<body>
	<div class="top_wrapper">
		<div class="text_centre">
			<div class="top_left">
				<span>  
					<a href="http://www.nottingham.ac.uk/xpert/">Back to main page</a>  
				</span>
			</div>
			<div class="top_right">
						<span>  <a href="feedsubmit.php">Submit a link</a>  </span><span>  <a href="rss.php">Subscribe to RSS</a>  </span><span><a href="about.php">About</a></span><span><a href="contributors.php">Contributors</a></span>
			</div>
		</div>
	</div>
	<div class="main_wrapper">
		<div class="index_holder">
			<div class="index_left">
					<img src="images/logo.gif" style="margin-top:20px" alt="Xpert logo" />
					<p>
						Please enter your keywords to search files
					</p>
					<form action="scoreresults.php" method="get" enctype="multipart/form-data">
						<input type="text" size="70" name="keywords" style="margin-bottom:15px" />
						<input type="image" src="images/search.gif" />
					</form>	
					<p>
						<a href="advancedsearch.php">Advanced search</a> | <a href="browse.php">Browse Resources</a>
					</p>
			</div>
			<div class="tag_cloud">
					<p>
						Popular Tags
					</p>
					<div style="float:left; position:relative; border-left:#D6D6D6 1px solid; padding-left:10px; font-weight:bold; font-family:serif;">
						<?

	include "xpert_database.php";
	
	xpert_database_connect($xpert_site);
	
	xpert_database_select($xpert_site);

	$query = "select count(resource_subject) as total, resource_subject from xpert_core_subject group by resource_subject order by total DESC limit 30";	
		
	$site_questions = xpert_database_multiple_select_query($query, $xpert_site);
	
	$results = array();
	
	$max = 0;
	$min = 0;

	$count=0;

	while($site_questions_object = xpert_database_fetch_object_from_response($site_questions)){
	
		$count++;
	
		if($count==30){
		
			$min = $site_questions_object->total;
		
		}
	
		if($max==0){
		
			$max = $site_questions_object->total;
		
		}
	
		array_push($results, $site_questions_object->total . "***" . $site_questions_object->resource_subject);
	
	}
	
	$range = $max - $min;
	
	$quartile = $range / 4;
	
	$index = array_keys($results);

	$list = array_rand($index, count($index));
	
	for($x=0;$x<count($list);$x++){
	
		$display_array = explode("***",$results[$index[$list[$x]]]);
		
		echo "<a style=\"color:#7C7C7C; text-decoration:none;\" onmouseover=\"this.style.textDecoration='underline'\" onmouseout=\"this.style.textDecoration='none'\" href=\"tagresults.php?tag=" . str_replace(" ","_",$display_array[1]) . "\"><font style=\"font-size:";
		
		if($display_array[0]>($max-$quartile)){
		
			echo "28pt\">" . str_replace("_"," ",$display_array[1]) . "</font></a> ";
		
		}else if($display_array[0]>($max-($quartile*2))){
		
			echo "24pt\">" . str_replace("_"," ",$display_array[1]) . "</font></a> ";
		
		}else if($display_array[0]>($max-($quartile*3))){

			echo "20pt\">" . str_replace("_"," ",$display_array[1]) . "</font></a> ";		
		
		}else{
		
			echo "16pt\">" . str_replace("_"," ",$display_array[1]) . "</font></a> ";
		
		}
		
	
	}
	
	
		
?>
					</div>					
			</div>
		</div>
	</div>
	<div style="width:100%; background-color:#FFF; clear:both; float:left; text-align:center; color:#8E8E8E; font-size:75%">
		Copyright 2009 University of Nottingham
	</div>
	<!-- Start - Webtrends tagging -->
<script type="text/javascript"
src="http://www.nottingham.ac.uk/common/webtrends/sdc-advanced-tracking.
js"></script>
<script type="text/javascript">
//<![CDATA[
	var gDomain = "uiwwwwbt01.ad.nottingham.ac.uk";
	var gDcsId  = "dcsuhohgd10000oiqfkmqufiu_6c8f"; // ]]> </script> <script type="text/javascript"
src="http://www.nottingham.ac.uk/common/webtrends/sdc.js"></script>
<noscript><img alt="" border="0" name="dcsimg" width="1" height="1"
src="http://uiwwwwbt01.ad.nottingham.ac.uk/dcsuhohgd10000oiqfkmqufiu_6c8
f/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=8.0.0"
/></noscript>
<!-- End - Webtrends tagging -->

</body>
</html>
